package com.rwdesign.springboot.Waimai.dao;

import com.rwdesign.springboot.Waimai.entity.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {

    /**
     * @return
     * @Author chendanping
     * @Description //TODO 查詢訂單
     * @Date 21:02 2022/3/2
     * @Param
     **/
    List<Order> selectAllOrders(@Param("orderStatus") String orderStatus, @Param("userId") Integer userId);

    /**
     * @return
     * @Author chendanping
     * @Description //TODO 查詢商户訂單
     * @Date 21:02 2022/3/2
     * @Param
     **/
    List<Order> selectShoperOrdersById(@Param("orderStatus") String orderStatus, @Param("shopId") Integer shopId);


    /**
     * @return
     * @Author chendanping
     * @Description //TODO 生成訂單
     * @Date 21:10 2022/3/2
     * @Param
     **/
    int insertOrder(Order record);

    /**
     * @return
     * @Author chendanping
     * @Description //TODO 结束訂單
     * @Date 21:10 2022/3/2
     * @Param
     **/
    int updateOrderEndTimeById(@Param("orderStatus") String orderStatus, @Param("orderEndTime") String orderEndTime, @Param("orderId") Integer orderId);


    int deleteByPrimaryKey(Integer orderId);

//    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer orderId);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);
}